package com.prs.crm.service.oa.impl;

import java.io.File;
import java.util.Collection;

import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.oa.WorkSummaryCritiqueDao;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.WorkSummaryCritique;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.oa.WorkSummaryCritiqueService;

public class WorkSummaryCritiqueServiceImpl extends BaseServiceImpl<WorkSummaryCritique,WorkSummaryCritiqueDao> implements WorkSummaryCritiqueService{

	@Override
	public void saveWorkSummaryCritique(
			WorkSummaryCritique workSummaryCritique, File file, String fileName) {
		// TODO Auto-generated method stub
		Attach attach = FileUtil.getInstance().saveFile(file, fileName, "", Constrains.UPLOAD_DIC_WORKSUMMARY);
		if(attach.getSrc() != null) {
			workSummaryCritique.setAttach(attach.getSrc());
		}
		this.getDao().save(workSummaryCritique);
	}

	@Override
	public Collection<WorkSummaryCritique> getValidWorkSummaryCritiqueInfo(
			Person person) {
		// TODO Auto-generated method stub
		return this.getDao().getValidWorkSummaryCritiqueInfo(person);
	}
	
}
